class Solution(object):
    def maxArea(self, height):
        """
        :type height: List[int]
        :rtype: int
        """
        max_v = 0
        left, right = 0, len(height) - 1
        while left < right:
            current_v = (right-left) * min(height[left], height[right])
            if current_v> max_v:
                max_v = current_v

            # 进行移动,移动最小的,以求v最大
            if height[left] < height[right]:
                left += 1   
            else:
                right -= 1
        return max_v


        
    
a = [1,8,6,2,5,4,8,3,7]
# a = [1,1]
print(Solution().maxArea(a))